import Taro, { Component, Config } from '@tarojs/taro'
import { View } from '@tarojs/components'
import { SDBody } from 'sudao-ui'
import SDUtils from 'sudao-utils'

import SDButton from '../../../comps/sd-button'

import './index.less'

export default class LaunchHomePage extends Component {

  config: Config = {
    backgroundColor: '#fff'
  }

  render () {
    return (
      <SDBody sd-class='container' loading={false}>
        <View className='main-content'>
          {/** TODO */}
        </View>
        <View className='btn-content'>
          <SDButton type='light' sd-class='btn-normal btn-first' onClick={this.onLoginBtnTaped}>登录</SDButton>
          <SDButton type='dark' sd-class='btn-normal' onClick={this.onApplyBtnTaped}>申请加入</SDButton>
        </View>
      </SDBody>
    )
  }

  onLoginBtnTaped = () => {
    SDUtils.jumpTo('/pages/launch/login/index')
  }

  onApplyBtnTaped = () => {
    SDUtils.jumpTo('/pages/launch/apply/edit/index')
  }
}
